From c3892874cb2933841307f42177b8da812f84f427 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Sat, 18 Mar 2017 01:13:42 +0000 Subject: [PATCH] css-overview: Fix+Explain color expr number ranges MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Last try, promise. They don’t all use 0 to 1. We should probably explain the effects too. Hopefully this manages that while not being too verbose --- docs/reference/gtk/css-overview.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/reference/gtk/css-overview.xml b/docs/reference/gtk/css-overview.xml index 3a7925e2b5..2b5c212eed 100644 --- a/docs/reference/gtk/css-overview.xml +++ b/docs/reference/gtk/css-overview.xml @@ -584,12 +584,16 @@ background-color: @bg_color; GTK+ also supports color expressions, which allow colors to be transformed to new ones and can be nested, providing a rich language to define colors. + Color expressions resemble functions, taking 1 or more colors and in some + cases a number as arguments. - Color expressions resemble functions, taking 1 or more colors and in some - cases a number as their arguments. The number is floating-point, clamped - between 0 and 1, and specifies the degree to which the expression will - transform the given color(s) in the manner that is indicated by its name. + shade() leaves the color unchanged when the number is 1 and transforms it + to black or white as the number approaches 0 or 2 respectively. For mix(), + 0 or 1 return the unaltered 1st or 2nd color respectively; numbers between + 0 and 1 return blends of the two; and numbers below 0 or above 1 intensify + the RGB components of the 1st or 2nd colour respectively. alpha() takes a + number from 0 to 1 and applies that as the opacity of the supplied color. 〈color expression〉 = lighter(〈color〉) | darker(〈color〉) | shade(〈color〉,〈number〉) | alpha(〈color〉,〈number〉) | mix(〈color〉,〈color〉,〈number〉) -- 2.30.2